package com.mbti.youmore.service;

import com.mbti.youmore.common.exception.PostNotExistException;
import com.mbti.youmore.entity.Comment;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
* @author Guqier
* @description 针对表【t_comment】的数据库操作Service
* @createDate 2024-05-08 20:30:45
*/
public interface CommentService extends IService<Comment> {

    int getCount(Integer postId) throws PostNotExistException;

    List<Map<String, Object>> getComments(Integer postId, Integer userId) throws PostNotExistException;

    @Transactional
    boolean publishComment(Comment comment);

    @Transactional
    boolean deleteComment(Integer commentId);
}
